{% load staticfiles %}
<!DOCTYPE html>
<html lang="zh-hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>失物招领</title>
    <link rel="stylesheet" href="{% static 'css\bootstrap.min.css' %}">
    <link rel="stylesheet" href="{% static 'css\navbar.css' %}">
    <link rel="stylesheet" href="{% static 'css\home.css' %}">
    <link rel="stylesheet" href="{% static 'css\rightPart.css' %}">
    <link rel="stylesheet" href="{% static 'css\leftPart.css' %}">
    <script type="text/javascript" src="{% static 'js\jquery-3.4.1.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'js\bootstrap.min.js' %}"></script>
</head>
<body>
<nav class="navbar navbar-inverse ">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{% url "main:home" %}"><img src="{% static "img\logo.jpg" %}" alt="失物招领"></a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <form method="POST" action="{% url "main:lost" %}" class="navbar-form navbar-left">

                {% csrf_token %}
                <div class="form-group">
                    <input name="search_info" type="text" class="form-control" placeholder="Search">
                </div>

                <button type="submit" class="btn btn-default">搜索 <span class="glyphicon glyphicon-search"
                                                                       aria-hidden="true"></span></button>

            </form>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="{% url "main:found" %}">失物</a></li>
                <li><a href="{% url "main:lost" %}" class="active">寻物</a></li>
                <li><a href="#">已找到</a></li>
                <li class="dropdown">
                    {% if user.is_authenticated %}
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-picture"
                                                                                                                                                  aria-hidden="true"></span> {{ user }}
                            <span class="caret"></span></a>
                        <ul class="dropdown-menu">

                            <li><a href="{% url "main:user_center" %}"><span class="glyphicon glyphicon-new-window" aria-hidden="true"> </span> 个人中心</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="{% url "main:log_out" %}"><span class="glyphicon glyphicon-log-out" aria-hidden="true"> </span> 登出</a>
                            </li>
                        </ul>
                    {% else %}
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-picture"
                                                                                                                                                  aria-hidden="true"></span> 未登录
                            <span class="caret"></span></a>
                        <ul class="dropdown-menu">

                            <li><a href="{% url "main:log_in" %}"><span class="glyphicon glyphicon-log-in" aria-hidden="true"> </span> 登录</a></li>
                            <li><a href="{% url "main:register" %}"><span class="glyphicon glyphicon-new-window" aria-hidden="true"> </span> 注册</a></li>

                            </li>
                        </ul>
                    {% endif %}

                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<div class="container">
    <!-- <a href="#" class="main-button">丢失</a>
    <a href="#" class="main-button">捡到</a> -->
</div>


<div class="container-fluid">
    <div class="row">
        <div class="col-md-3 left-part">
            <div class="btn-group">
              <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                   我要发布 <span class="glyphicon glyphicon-plus"  aria-hidden="true"></span><span class="caret"></span>
              </button>
              <ul class="dropdown-menu">
                <li><a href="{% url "main:publish_lost" %}">我丢失了物品 </a></li>
                <li role="separator" class="divider"></li>
                <li><a href="{% url "main:publish_found" %}">我捡到了物品 </a></li>
              </ul>
            </div>
            <br>
            <div class="typebar">

                <h3>分类</h3>
                <div class="list-group">
                  <a href="{% url "main:lost" %}" class="list-group-item">全部<span class="badge">{{ all }}</span></a>
                  <a href="{% url "main:lost_card" %}" class="list-group-item">校园卡<span class="badge">{{ card }}</span></a>
                  <a href="{% url "main:lost_book" %}" class="list-group-item">书籍<span class="badge">{{ book }}</span></a>
                  <a href="{% url "main:lost_elec" %}" class="list-group-item">电子产品<span class="badge">{{ elec }}</span></a>
                  <a href="{% url "main:lost_study" %}" class="list-group-item">学习用品<span class="badge">{{ study }}</span></a>
                  <a href="{% url "main:lost_live" %}" class="list-group-item">生活用品<span class="badge">{{ live }}</span></a>
                  <a href="{% url "main:lost_val" %}" class="list-group-item">贵重物品<span class="badge">{{ val }}</span></a>
                  <a href="{% url "main:lost_other" %}" class="list-group-item">其他<span class="badge">{{ other }}</span></a>
                </div>
            </div>

        </div>
        <div class="col-md-9 right-part">

          {% for item in lost_items %}
          <div class="item">
            <div class="top-part">
              <div class="people-name">
                <a href="#"><span class="glyphicon glyphicon-user"aria-hidden="true"> </span> {{item.item_publisher}}</a>
                丢失了物品
                <a href="#">{{item.item_name}}</a>
              </div>
              <div class="time">
                {{ item.item_time }}
              </div>
            </div>
            <div class="item-part">
            <span class="label label-success item-name">{{ item.item_type }}</span>
            {% if item.item_status == False %}
            <button class="btn" type="button" name="button" > <a href="{% url 'main:lostitem_return' forloop.counter %}"><span class="glyphicon glyphicon-star"aria-hidden="true" ></span>我捡到了</a> </button>
            {% else %}
            <button class="btn" type="button" disabled="disabled" name="button"><span class="glyphicon glyphicon-star"aria-hidden="true"> </span>已经寻回</button>
            {% endif %}
            <div class="description">
                {{ item.item_description }}
            </div>

            </div>
          </div>
          {% endfor %}
        </div>
    </div>
</div>


</body>
</html>
